home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 25 / Cream of the Crop 25.iso / bbs / doorinfo.zip / FSUBS.ASM < prev    next >
Assembly Source File  |  1997-05-14  |  11KB  |  524 lines

  1. ;
  2. ; This is aset of C-linkable routines, in large model, for directly
  3. ; calling a Fossil driver.
  4. ;
  5. fsubs_text    segment word public 'CODE'
  6.         assume  cs:fsubs_text
  7.  
  8. public  _f_recv
  9. public  _f_send
  10. public  _f_status
  11. public  _f_setbaud
  12. public  _f_initialize
  13. public  _f_dtr
  14. public  _f_break
  15. public  _f_flushin
  16. public  _f_flushout
  17. public  _f_flowctrl
  18. public  _f_purgeout
  19. public  _f_deinit
  20. public  _f_writechar
  21. public  _f_readchar
  22. public  _f_getinfo
  23. public  _f_setbufsize
  24. public  _f_defline
  25. public  _f_insertchar
  26. public  _f_getioport
  27. public  _f_kill
  28. public  _f_getmaxbuf
  29. public  _f_setmonline
  30. public  _f_readmonbuf
  31. public  _f_lock
  32. public  _f_getoba
  33. public  _f_getibw
  34. public  _f_getfc
  35. public  _f_insertmult
  36. public  _f_readoutbuf
  37. public  _f_ovrunerrs
  38. public  _f_stufit
  39. public  _f_unstufit
  40.  
  41. _f_ovrunerrs proc    far
  42.         push    bp
  43.         mov     bp,sp
  44.         push    dx
  45.         mov     dx,[bp+6]
  46.         mov     ah,4eh
  47.         int     14h
  48.         pop     dx
  49.         pop     bp
  50.         ret
  51. _f_ovrunerrs endp
  52.  
  53. _f_recv proc    far
  54.         push    bp
  55.         mov     bp,sp
  56.         push    cx
  57.         push    es
  58.         push    di
  59.         push    dx
  60.         mov     dx,[bp+6]       ;line number
  61.         mov     ax,[bp+10]       ;segment
  62.         mov     es,ax
  63.         mov     di,[bp+8]       ;offset
  64.         mov     cx,[bp+12]      ;count
  65.         mov     ah,18h
  66.         int     14h
  67.         pop     dx
  68.         pop     di
  69.         pop     es
  70.         pop     cx
  71.         pop     bp
  72.         ret
  73. _f_recv endp
  74.  
  75. _f_readoutbuf proc    far
  76.         push    bp
  77.         mov     bp,sp
  78.         push    cx
  79.         push    es
  80.         push    di
  81.         push    dx
  82.         mov     dx,[bp+6]       ;line number
  83.         mov     ax,[bp+10]       ;segment
  84.         mov     es,ax
  85.         mov     di,[bp+8]       ;offset
  86.         mov     cx,[bp+12]      ;count
  87.         mov     ah,4fh
  88.         int     14h
  89.         pop     dx
  90.         pop     di
  91.         pop     es
  92.         pop     cx
  93.         pop     bp
  94.         ret
  95. _f_readoutbuf endp
  96.  
  97. _f_insertmult proc    far
  98.         push    bp
  99.         mov     bp,sp
  100.         push    cx
  101.         push    es
  102.         push    di
  103.         push    dx
  104.         mov     dx,[bp+6]       ;line number
  105.         mov     ax,[bp+10]       ;segment
  106.         mov     es,ax
  107.         mov     di,[bp+8]       ;offset
  108.         mov     cx,[bp+12]      ;count
  109.         mov     ah,4eh
  110.         int     14h
  111.         pop     dx
  112.         pop     di
  113.         pop     es
  114.         pop     cx
  115.         pop     bp
  116.         ret
  117. _f_insertmult endp
  118.  
  119. _f_send proc    far
  120.         push    bp
  121.         mov     bp,sp
  122.         push    cx
  123.         push    es
  124.         push    di
  125.         push    dx
  126.         mov     dx,[bp+6]       ;line number
  127.         mov     ax,[bp+10]       ;segment
  128.         mov     es,ax
  129.         mov     di,[bp+8]       ;offset
  130.         mov     cx,[bp+12]      ;count
  131.         mov     ah,19h
  132.         int     14h
  133.         pop     dx
  134.         pop     di
  135.         pop     es
  136.         pop     cx
  137.         pop     bp
  138.         ret
  139. _f_send endp
  140.  
  141. _f_getinfo proc    far
  142.         push    bp
  143.         mov     bp,sp
  144.         push    cx
  145.         push    es
  146.         push    di
  147.         push    dx
  148.         mov     dx,[bp+6]       ;line number
  149.         mov     ax,[bp+10]       ;segment
  150.         mov     es,ax
  151.         mov     di,[bp+8]       ;offset
  152.         mov     cx,[bp+12]      ;count
  153.         mov     ah,1bh
  154.         int     14h
  155.         pop     dx
  156.         pop     di
  157.         pop     es
  158.         pop     cx
  159.         pop     bp
  160.         ret
  161. _f_getinfo endp
  162.  
  163. _f_status       proc    far
  164.         push    bp
  165.         mov     bp,sp
  166.         push    dx
  167.         mov     dx,[bp+6]
  168.         mov     ah,3
  169.         int     14h
  170.         pop     dx
  171.         pop     bp
  172.         ret
  173. _f_status       endp
  174.  
  175. _f_setbaud      proc    far
  176.         push    bp
  177.         mov     bp,sp
  178.         push    dx
  179.         mov     dx,[bp+6]
  180.         mov     ax,[bp+8]       ;get line parameters
  181.         mov     ah,0
  182.         int     14h
  183.         pop     dx
  184.         pop     bp
  185.         ret
  186. _f_setbaud      endp
  187.  
  188. _f_initialize   proc    far
  189.         push    bp
  190.         mov     bp,sp
  191.         push    dx
  192.         mov     dx,[bp+6]
  193.         mov     ah,4
  194.         int     14h
  195.         pop     dx
  196.         pop     bp
  197.         ret
  198. _f_initialize   endp
  199.  
  200. _f_dtr  proc    far
  201.         push    bp
  202.         mov     bp,sp
  203.         push    dx
  204.         mov     dx,[bp+6]
  205.         mov     ax,[bp+8]       ;get dtr parameters
  206.         mov     ah,6
  207.         int     14h
  208.         pop     dx
  209.         pop     bp
  210.         ret
  211. _f_dtr  endp
  212.  
  213. _f_break  proc    far
  214.         push    bp
  215.         mov     bp,sp
  216.         push    dx
  217.         mov     dx,[bp+6]
  218.         mov     ax,[bp+8]       ;get break parameters
  219.         mov     ah,6
  220.         int     14h
  221.         pop     dx
  222.         pop     bp
  223.         ret
  224. _f_break  endp
  225.  
  226. _f_flushin      proc    far
  227.         push    bp
  228.         mov     bp,sp
  229.         push    dx
  230.         mov     dx,[bp+6]
  231.         mov     ah,0ah
  232.         int     14h
  233.         pop     dx
  234.         pop     bp
  235.         ret
  236. _f_flushin      endp
  237.  
  238. _f_flushout     proc    far
  239.         push    bp
  240.         mov     bp,sp
  241.         push    dx
  242.         mov     dx,[bp+6]
  243.         mov     ah,9
  244.         int     14h
  245.         pop     dx
  246.         pop     bp
  247.         ret
  248. _f_flushout     endp
  249.  
  250. ;
  251. ; what flow control is currently active ?
  252. ;
  253. _f_getfc     proc    far
  254.         push    bp
  255.         mov     bp,sp
  256.         push    dx
  257.         mov     dx,[bp+6]
  258.         mov     ah,48h
  259.         int     14h
  260.         pop     dx
  261.         pop     bp
  262.         ret
  263. _f_getfc     endp
  264.  
  265. _f_flowctrl     proc    far
  266.         push    bp
  267.         mov     bp,sp
  268.         push    dx
  269.         mov     dx,[bp+6]
  270.         mov     ax,[bp+8]       ;get flow control parameters
  271.         mov     ah,0fh
  272.         int     14h
  273.         pop     dx
  274.         pop     bp
  275.         ret
  276. _f_flowctrl     endp
  277.  
  278. _f_purgeout     proc    far     ;wait until output buffer is empty
  279.         push    bp
  280.         mov     bp,sp
  281.         push    dx
  282. fp_loop:
  283.         mov     ah,1
  284.         int     62h
  285.         mov     dx,[bp+6]
  286.         mov     ah,3            ;get status
  287.         int     14h
  288.         test    ah,40h          ;output buffer empty ?
  289.         jz      fp_loop
  290.         pop     dx
  291.         pop     bp
  292.         ret
  293. _f_purgeout     endp
  294.  
  295. _f_deinit proc  far
  296.         push    bp
  297.         mov     bp,sp
  298.         push    dx
  299.         push    bx
  300.         mov     dx,[bp+6]
  301.         mov     ah,5
  302.         int     14h
  303.         pop     bx
  304.         pop     dx
  305.         pop     bp
  306.         ret
  307. _f_deinit endp
  308.  
  309. _f_writechar  proc    far
  310.         push    bp
  311.         mov     bp,sp
  312.         push    dx
  313.         mov     dx,[bp+6]
  314.         mov     ax,[bp+8]       ;get char to write
  315.         mov     ah,0bh
  316.         int     14h
  317.         pop     dx
  318.         pop     bp
  319.         ret
  320. _f_writechar  endp
  321.  
  322. _f_readchar  proc    far
  323.         push    bp
  324.         mov     bp,sp
  325.         push    dx
  326.         mov     dx,[bp+6]
  327.         mov     ah,2
  328.         int     14h
  329.         xor     ah,ah   ;get rid of hi byte
  330.         pop     dx
  331.         pop     bp
  332.         ret
  333. _f_readchar  endp
  334.  
  335. ; parameters : line, address, irq
  336.  
  337. _f_defline proc far
  338.         push    bp
  339.         mov     bp,sp
  340.         push    di
  341.         push    dx
  342.         push    cx
  343.         push    bx
  344.         mov     dx,[bp+6]
  345.         mov     bx,[bp+8]
  346.         mov     cx,[bp+10]
  347.         mov     di,[bp+12]      ;buffer para address
  348.         mov     ah,40h
  349.         int     14h
  350.         pop     bx
  351.         pop     cx
  352.         pop     dx
  353.         pop     di
  354.         pop     bp
  355.         ret
  356. _f_defline endp
  357.  
  358. _f_getioport    proc    far
  359.         push    bp
  360.         mov     bp,sp
  361.         push    dx
  362.         push    bx
  363.         push    si
  364.         push    es
  365.         mov     ah,41h
  366.         int     14h
  367.         mov     dx,ax
  368.         mov     si,[bp+6]
  369.         mov     ax,[bp+8]
  370.         mov     es,ax
  371.         mov     es:[si],bx  ;offset of address
  372.         mov     es:[si+2],dx    ;segment
  373.         pop     es
  374.         pop     si
  375.         pop     bx
  376.         pop     dx
  377.         pop     bp
  378.         ret
  379. _f_getioport    endp
  380.  
  381. _f_kill proc    far
  382.         mov     ah,42h
  383.         int     14h
  384.         ret
  385. _f_kill endp
  386.  
  387. _f_setbufsize proc far
  388.         push    bp
  389.         mov     bp,sp
  390.         push    dx
  391.         push    cx
  392.         push    bx
  393.         mov     dx,[bp+6]
  394.         mov     bx,[bp+8]
  395.         mov     cx,[bp+10]
  396.         mov     ah,43h
  397.         int     14h
  398.         pop     bx
  399.         pop     cx
  400.         pop     dx
  401.         pop     bp
  402.         ret
  403. _f_setbufsize endp
  404.  
  405. _f_getmaxbuf    proc    far     ;return maximum buffer size useable
  406.         mov     ah,44h
  407.         int     14h
  408.         ret
  409. _f_getmaxbuf    endp
  410.  
  411. _f_setmonline   proc    far
  412.         push    bp
  413.         mov     bp,sp
  414.         push    dx
  415.         mov     dx,[bp+6]
  416.         mov     ah,45h
  417.         int     14h
  418.         pop     dx
  419.         pop     bp
  420.         ret
  421. _f_setmonline   endp
  422.  
  423. _f_readmonbuf   proc    far
  424.         push    bp
  425.         mov     bp,sp
  426.         push    es
  427.         push    di
  428.         mov     di,[bp+6]       ;offset of buffer
  429.         mov     ax,[bp+8]      ;segment
  430.         mov     es,ax
  431.         mov     ah,46h
  432.         int     14h
  433.         pop     di
  434.         pop     es
  435.         pop     bp
  436.         ret
  437. _f_readmonbuf   endp
  438.  
  439. ;
  440. ; insert a character onto the line's input queue
  441. ;
  442.  
  443. _f_insertchar   proc    far
  444.         push    bp
  445.         mov     bp,sp
  446.         push    dx
  447.         mov     dx,[bp+6]
  448.         mov     ax,[bp+8]
  449.         mov     ah,49h
  450.         int     14h
  451.         pop     dx
  452.         pop     bp
  453.         ret
  454. _f_insertchar   endp
  455.  
  456. ;
  457. ; lock or unlock line settings, if al ==1 lock, if al == 0, unlock
  458. ;
  459.  
  460. _f_lock   proc    far
  461.         push    bp
  462.         mov     bp,sp
  463.         push    dx
  464.         mov     dx,[bp+6]
  465.         mov     ax,[bp+8]
  466.         mov     ah,4ah
  467.         int     14h
  468.         pop     dx
  469.         pop     bp
  470.         ret
  471. _f_lock   endp
  472.  
  473. _f_getoba       proc    far
  474.         push    bp
  475.         mov     bp,sp
  476.         push    dx
  477.         mov     dx,[bp+6]
  478.         mov     ah,4bh
  479.         int     14h
  480.         pop     dx
  481.         pop     bp
  482.         ret
  483. _f_getoba       endp
  484.  
  485. _f_getibw       proc    far
  486.         push    bp
  487.         mov     bp,sp
  488.         push    dx
  489.         mov     dx,[bp+6]
  490.         mov     ah,4ch
  491.         int     14h
  492.         pop     dx
  493.         pop     bp
  494.         ret
  495. _f_getibw       endp
  496.  
  497. _f_stufit       proc    far
  498.         push    bp
  499.         mov     bp,sp
  500.         push    dx
  501.         mov     dx,[bp+6]
  502.         mov     ah,050h
  503.         int     14h
  504.         pop     dx
  505.         pop     bp
  506.         ret
  507. _f_stufit       endp
  508.  
  509. _f_unstufit       proc    far
  510.         push    bp
  511.         mov     bp,sp
  512.         push    dx
  513.         mov     dx,[bp+6]
  514.         mov     ah,051h
  515.         int     14h
  516.         pop     dx
  517.         pop     bp
  518.         ret
  519. _f_unstufit       endp
  520.  
  521. fsubs_text     ends
  522.         end
  523.  
  524.